package com.laolang.ssh.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;


/**
 * 首页处理器，在访问首页时，做初始化工作，如初始化显示的类别
 * 
 * @author 小代码
 * @version 1.0
 *
 */
@Controller
public class IndexController {

	@RequestMapping(value={"/"},method=RequestMethod.HEAD,produces="text/html")
	public String head(){
		return "index";
	}
	
	/**
	 * 
	 * @param model
	 * @return
	 */
	@RequestMapping(value={"/","index"},method=RequestMethod.GET,produces="text/html")
	public String index( Model model ){
		model.addAttribute("msg", "Hello SpringMVC!");
		return "index";
	}
}
